package cn.icanci.basic.exception;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: icanci
 * @date: Created in 2020/11/28 10:07
 * @classAction: 自定义异常
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ApplicationException extends RuntimeException {
    /**
     * 状态码
     */
    private Integer code;
    /**
     * 异常信息
     */
    private String  msg;

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("ApplicationException{");
        sb.append("code=").append(code);
        sb.append(", msg='").append(msg).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
